/**
 * Created by Admin on 30.12.2014.
 */

var ShaderLoader = (function ($) {

    return $.inherit(AjaxQueue, {

        _prepareShaderUrl: function (name, shaderType) {
            return $.format("{0}/{1}.{2}.glsl", GlShader.SHADERS_PATH, name, shaderType)
        },

        __constructor: function(shaderMetadata, options){
            var shaderLoader = this;
            var name = shaderMetadata.name;
            this.__base({
                vertex: {
                    url: shaderLoader._prepareShaderUrl(name, GlShader.VERTEX)
                },
                fragment: {
                    url: shaderLoader._prepareShaderUrl(name, GlShader.FRAGMENT)
                }
            }, options);
        }

    })

})(window["jQuery"]);